import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int num = in.nextInt();
            int count = 0;
//            while(num>0){
//                if(num%2==1){
//                    count+=1;
//                }
//                num/=2;
//            }
            while(num>0){
                if((num&1)==1){
                    count+=1;
                }
                num>>=1;
            }

            System.out.println(count);
        }
    }
}
